﻿<!--#INCLUDE FILE="config.asp"-->
<%
if(Session("AdminAccessLevel") <> 1 and Session("AdminAccessLevel") <> 3) then
	Response.Redirect("admin-login.asp?msg=invalid")
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../styles.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<!-- DATE PICKER SCRIPT -->
<link type="text/css" href="../css/jquery-ui-1.8.21.custom.css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.21.custom.min.js"></script>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
    $('#list_table tr:nth-child(2n+1)').addClass('alternate');
});
</script>

  

<title>Admin Panel de Control :: Costa Baja</title>

</head>

<body>

<div id="main_wrapper">
    	<div class="main_wrapper_margin">
        	
            <div class="admin_top_menu">
            <!--#INCLUDE FILE="admin_menu.asp"--> 
           	</div><!-- END costa_top_menu -->
             
			<h1>Panel de Control</h1>
            <div class="clear"></div>
            
            
            
            <div class="dashboad_wrapper">
              
  <table id="list_table" width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr class="titles">
    <td>Ingresar CODIGO</td>
    <td>campaña</td>
	<td>Originador </td>
	<td>Producto </td>
	<td>Propiedad</td>
    <td>Fecha de caducidad</td>
     <td>&nbsp;</td>
  </tr>
    <%
sqlstring = ""
sqlstring = sqlstring & "SELECT *,Products.ProductName, Propertys.PropertyName  FROM Codes "
sqlstring = sqlstring & " Inner join Products on Products.ProductID = Codes.ProductID "
sqlstring = sqlstring & " INNER JOIN Propertys on Propertys.PropertyID = Codes.PropertyID  "

set objConnect = server.createObject("ADODB.Connection")   

objConnect.Open conStr

set TblTemp = server.createobject("Adodb.Recordset")
		
		TblTemp.Open Sqlstring, objConnect
		
		Do Until TblTemp.EOF
			cId = TblTemp("CodeID")
			code = TblTemp("Code")
			campaign = TblTemp("Campaign")
			expdate = TblTemp("ExpDate")
			originator = TblTemp("Originator")
			product = TblTemp("ProductName")
			properties = TblTemp("PropertyName")
%>
  <tr>
    <td><strong><%=code%></strong></td>
    <td><%=campaign%> <%=re_Name%></td>
    <td><%if (expdate < Date()) then%>
		<font color="red"><%=expdate%></font>
		<%else %>
		<%=expdate%>
		<%end if%>
	</td>
	<td><%=originator%></td>
	<td><%=product%></td>
	<td><%=properties%></td>
	<td>
	<%if (expdate < Date()) then%>
		<a href="fei_campaign_extend.asp?cId=<%=cId%>">Extend</a>
	<%end if%></td>
<%
	TblTemp.MoveNext
	Loop

%>
</table>
            
            </div><!-- .dashboad_wrapper -->
                        
    	</div><!-- END .main_wrapper_margin -->
        
	</div><!-- END #main_wrapper -->

         <!-- FOOTER -->
         
         <!--#INCLUDE file="admin_footer.asp"-->
         
         <!-- END FOOTER -->   

</body>
</html>
